package com.hdax.dmw.item.api;

import com.hdax.dmw.common.utils.Result;
import com.hdax.dmw.item.dtos.ItemDescDto;
import com.hdax.dmw.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(path = "/desc")
public class ItemDescApi {

    @Autowired
    private ItemService itemService;

    @PostMapping(path = "/getItems")
    public Result<ItemDescDto> getItems(@RequestBody Map<String,Long> params){
        Long itemId = params.get("id");
        return itemService.getItems(itemId);
    }
}
